
/****** Object:  Table [dbo].[EmailQueue]    Script Date: 06/10/2011 11:32:11 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[EmailQueue](
	[EmailQueueId] [bigint] IDENTITY(1,1) NOT NULL,
	[SenderName] [varchar](255) NOT NULL,
	[SenderAddress] [varchar](255) NOT NULL,
	[RecipientAddress] [varchar](255) NOT NULL,
	[Subject] [varchar](max) NOT NULL,
	[Message] [varchar](max) NOT NULL,
	[DoNotSendBefore] [datetime] NULL,
	[SentDate] [datetime] NULL,
	[SentErrorDate] [datetime] NULL,
 CONSTRAINT [PK_EmailQueue] PRIMARY KEY CLUSTERED 
(
	[EmailQueueId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO



/****** Object:  Table [dbo].[LoginUser]    Script Date: 06/10/2011 11:32:39 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[LoginUser](
	[LoginUserId] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](255) NOT NULL,
	[Email] [varchar](255) NOT NULL,
	[PasswordHash] [varchar](255) NOT NULL,
	[CreatedDate] [datetime] NOT NULL,
	[DeletedDate] [datetime] NULL,
	[ChangePasswordOnNextLogin] [bit] NOT NULL,
 CONSTRAINT [PK_LoginUser] PRIMARY KEY CLUSTERED 
(
	[LoginUserId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[LoginHistory]    Script Date: 06/10/2011 11:32:24 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[LoginHistory](
	[LoginHistoryId] [bigint] IDENTITY(1,1) NOT NULL,
	[LoginUserId] [bigint] NULL,
	[LoginName] [varchar](255) NOT NULL,
	[Success] [bit] NOT NULL,
	[Timestamp] [datetime] NOT NULL,
	[SuspendedUntil] [datetime] NULL,
 CONSTRAINT [PK_LoginHistory] PRIMARY KEY CLUSTERED 
(
	[LoginHistoryId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[LoginHistory]  WITH CHECK ADD  CONSTRAINT [FK_LoginHistory_LoginUser] FOREIGN KEY([LoginUserId])
REFERENCES [dbo].[LoginUser] ([LoginUserId])
GO

ALTER TABLE [dbo].[LoginHistory] CHECK CONSTRAINT [FK_LoginHistory_LoginUser]
GO



/****** Object:  Table [dbo].[PasswordHistory]    Script Date: 06/10/2011 11:32:54 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[PasswordHistory](
	[PasswordHistoryId] [bigint] IDENTITY(1,1) NOT NULL,
	[LoginUserId] [bigint] NOT NULL,
	[PasswordHash] [varchar](255) NOT NULL,
	[CreatedDate] [datetime] NOT NULL,
 CONSTRAINT [PK_PasswordHistory] PRIMARY KEY CLUSTERED 
(
	[PasswordHistoryId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[PasswordHistory]  WITH CHECK ADD  CONSTRAINT [FK_PasswordHistory_LoginUser] FOREIGN KEY([LoginUserId])
REFERENCES [dbo].[LoginUser] ([LoginUserId])
GO

ALTER TABLE [dbo].[PasswordHistory] CHECK CONSTRAINT [FK_PasswordHistory_LoginUser]
GO

/****** Object:  Table [dbo].[SiteAttributeStore]    Script Date: 06/10/2011 11:33:07 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[SiteAttributeStore](
	[SiteAttributeStoreId] [bigint] IDENTITY(1,1) NOT NULL,
	[KeyName] [varchar](255) NOT NULL,
	[Value] [varchar](max) NOT NULL,
 CONSTRAINT [PK_Store] PRIMARY KEY CLUSTERED 
(
	[SiteAttributeStoreId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_SiteAttributeStore_Unique_KeyName] UNIQUE NONCLUSTERED 
(
	[KeyName] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[TextTranslation]    Script Date: 06/10/2011 11:33:28 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[TextTranslation](
	[TextTranslationId] [bigint] IDENTITY(1,1) NOT NULL,
	[LanguageType] [int] NOT NULL,
	[Guid] [uniqueidentifier] NOT NULL,
	[Text] [varchar](max) NOT NULL,
 CONSTRAINT [PK_TextTranslation] PRIMARY KEY CLUSTERED 
(
	[TextTranslationId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

